public class NotifyAll implements Runnable{
    private Object object;
    public NotifyAll(Object object) {
        this.object=object;
    }

    @Override
    public void run() {
        synchronized (object){
            System.out.println("notifyall开始");
            object.notifyAll();
            System.out.println("notifyall结束");
        }
    }
}
